import { createApp, nextTick } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// import '@/assets/commonTs/routerBerfor';
import Antd from 'ant-design-vue'
const app = createApp(App);
app.use(Antd);
import 'ant-design-vue/dist/antd.css';
import '@/assets/css/common.css';
import '@/assets/font/iconfont.css';
router.beforeEach((to,from,next)=>{

        if(to.name=='Login'&&to.path=='/login'||to.name=='404'&&to.path=='/404'){
            next();
           }else{
               if(to.name==undefined){
                next('/404')
               }else{
                   if(!store.state.token){
                    next('/login')
                   }else{
                    next();
                   }
                 
                  
               }
             
            }
 
})
app.use(store).use(router).mount('#app')
